﻿/*
#------------------------------------------------------------------------------
#-- Program Name:	[dbo].[GetFiles]
#-- Purpose:		Calls a CLR function to get a list of files in a directory
#--	Last Update:	09/21/2011
#--					For a complete history - please review comments in Version
#--					Control.
#------------------------------------------------------------------------------
*/
CREATE FUNCTION [dbo].[GetFiles]
(
	@directoryPath		nvarchar(4000),
	@recursive			bit					= 0
)
RETURNS TABLE 
(
	physical_device_name		nvarchar(4000)
)
WITH EXECUTE AS CALLER
AS
EXTERNAL NAME [centraldba_clr].[UserDefinedFunctions].[GetFiles]
